//
//  AccountListCell.m
//  Ginix
//
//  Created by ff on 2025/3/10.
//

#import "AccountListCell.h"

@interface AccountListCell()
@property (nonatomic,strong) UILabel * nameLabel;
@property (nonatomic,strong) UIImageView * iconView;
@property (nonatomic,strong) UIView * line;
@end

@implementation AccountListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setSubViewLayout];
    }
    return self;
}

-(void)setSubViewLayout{
    
    [self addSubview:self.nameLabel];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(20 * FMScaleX);
        make.centerY.equalTo(@0);
    }];
    [self addSubview:self.iconView];
    [_iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_offset(-20 * FMScaleX);
        make.centerY.equalTo(@0);
        make.size.mas_offset(CGSizeMake(24 * FMScaleX, 24 * FMScaleX));
    }];
//    [self addSubview:self.line];
//    [_line mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.bottom.equalTo(@0);
//        make.size.mas_offset(CGSizeMake(345 * FMScaleX, 1));
//        make.centerX.equalTo(@0);
//    }];
    
}

-(void)setIndex:(NSInteger)index{
    
    if (index == 0) {
        self.nameLabel.text = @"修改密码";
    }else{
        self.nameLabel.text = @"注销账号";
    }
    
}

-(UILabel *)nameLabel{
    
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.font = Regular(14);
        _nameLabel.textColor = RDRGB(0x999999);
    }
    return _nameLabel;
}
-(UIImageView *)iconView{
    
    if (!_iconView) {
        _iconView = [[UIImageView alloc]init];
        _iconView.image = [UIImage imageNamed:@"Me_head_arrow"];
    }
    return _iconView;
}
-(UIView *)line{
    
    if (!_line) {
        _line = [[UIView alloc]init];
        _line.backgroundColor = RDRGB(0x666666);
    }
    return _line;
}

@end
